﻿@{
    ViewBag.Title = "保存产品页面_b_i";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model MiniWeb.Web.Controllers.Admin.ProductsInfoManager.ViewModels.SaveProductsInfo
<link href="../../Scripts/jquery-validation-engine/css/template.css" rel="stylesheet"
    type="text/css" />
<link href="../../Scripts/jquery-validation-engine/css/validationEngine.jquery.css"
    rel="stylesheet" type="text/css" />
<link href="../../Scripts/kindeditor-4.1.4/themes/default/default.css" rel="stylesheet"
    type="text/css" />
<script src="../../Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-validation-engine/js/jquery.validationEngine.js"
    type="text/javascript"></script>
<script src="../../Scripts/jquery-validation-engine/js/languages/jquery.validationEngine-zh_CN.js"
    type="text/javascript"></script>
<script src="../../Scripts/kindeditor-4.1.4/kindeditor-min.js" type="text/javascript"></script>
<script src="../../Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $("#form1").validationEngine();
                var editor = KindEditor.create('textarea[name="Des"]', {
            uploadJson: "@Url.Action("SaveSystemImage", "Uploads")",
            syncType: '',
            items: [
                'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste', 'plainpaste', 'wordpaste', '|',
                'justifyleft', 'justifycenter', 'justifyright', 'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'lineheight',
                'removeformat', '|', 'image', 'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'pagebreak', //'multiimage','baidumap'
                'anchor', 'link', 'unlink', '|', 'about'
            ],
            afterBlur: function() {
                editor.sync();
            }
        });
        
        
           loadServer();
        $("#ProductsTypeID").change(function () {
            loadServer();
        });
        function loadServer() {
            var gameid = $('#ProductsTypeID');
            var serverlist = $('#ProductsClassID');

            var gameid = gameid.val();
            serverlist.empty();

            $.getJSON('@Url.Action("GetClass", "ProductsClassManager")', { tid: gameid }, function (data) {
                $.each(data, function (i, item) {
                    $("<option></option>").val(item["Value"]).text(item["Text"]).appendTo(serverlist);
                });
                serverlist.val('@Model.ProductsClassID');
            });
        }
        
        
        
           })
</script>
<style>
    .baodiv
    {
        width: 200px;
        border-right: 2px solid #c3c3c3;
        padding: 2px;
        float: left;
        margin-left: 10px;
        margin: 5px auto;
        text-align: center;
    }
    .imgdiv
    {
        margin: 5px auto;
        text-align: center;
        padding-left: 30px;
    }
    .bigdiv
    {
        background-color: #FFE6D9;
        border: 1px solid #FF9D6F;
    }
    .baoimg
    {
        margin: 5px auto;
        text-align: center;
    }
</style>
<div class="wrap">
    <div class="right_box_card">
        <ul>
            <li class="right_box_card1"><a href="#">保存产品页面_b_i</a></li>
        </ul>
    </div>
    <div>
        <div style="color: red;">
        </div>
        @using (Html.BeginForm("Save", "ProductsInfoManager", FormMethod.Post, new { @class = "formular", id = "form1", enctype = "multipart/form-data" }))
        {
            @Html.HiddenFor(c => c.ID)
            <table class="enter_tab" width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.ProductsTypeID)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.DropDownList("ProductsTypeID", ViewData["typelist"] as List<SelectListItem>, new { @class = "validate[required] text-input", style = "" })
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.ProductsClassID)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.DropDownListFor(c => c.ProductsClassID, new List<SelectListItem>(), new { @class = "validate[required] text-input", style = "" })
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.ProductsName)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.TextBoxFor(c => c.ProductsName, new { @class = "validate[required] text-input", style = "" })
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.JianJie)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.TextAreaFor(c => c.JianJie, new { @class = "validate[required] text-input", @style = "width:650px;height:50px;" })
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.Price)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.TextBoxFor(c => c.Price, new { @class = "validate[required] text-input", style = "" })
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.CPrice)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.TextBoxFor(c => c.CPrice, new { @class = "validate[required] text-input" })
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.KuCunNum)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.TextBoxFor(c => c.KuCunNum, new { @class = "validate[required] text-input" })
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.TotalNum)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.TextBoxFor(c => c.TotalNum, new { @class = "validate[required] text-input" })
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.SellNum)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.TextBoxFor(c => c.SellNum, new { @class = "validate[required] text-input" })
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.IsChuXiao)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.CheckBoxFor(c => c.IsChuXiao, new { @class = " text-input" })
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.IsWeb)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.CheckBoxFor(c => c.IsWeb, new { @class = "text-input" })
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.IsSell)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.CheckBoxFor(c => c.IsSell, new { @class = " text-input" })
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.IsHot)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.CheckBoxFor(c => c.IsHot, new { @class = "text-input" })
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.Sort)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.TextBoxFor(c => c.Sort, new { @class = "validate[required] text-input" })
                    </td>
                </tr>

                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.Des)
                    </td>
                    <td class="entry_tab_td2">
                        @Html.TextAreaFor(c => c.Des, new { @class = " text-input", @style = "width:650px;height:400px;" })
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">@Html.LabelFor(c => c.ProductImg)
                    </td>
                    <td class="entry_tab_td2 ">
                 
                      <div  style="width:200px; height: 100%;">
                            <div class="baoimg">
                                <img src="@Model.ProductImg" width="100" height="100" />
                            </div>
                            <div class="imgdiv">
                                  <input type="file" name="ProductImg" />
                            </div>
                            
                        </div>
                   
                    </td>
                </tr>
                <tr height="40">
                    <td class="entry_tab_td1">
                        商品轮播图
                    </td>
                    <td class="entry_tab_td2">
                      <a href="/ProductsImgInfoManager/list?pid=@Model.ID" style="color: #2894FF;">添加轮播图</a>
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td style="line-height: 30px;">@Html.ValidationSummary()
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type="submit" value="保存" class="submit" style="width: 100px; height: 30px;" />
                    </td>
                    <td>
                    </td>
                </tr>
            </table> 
        }
    </div>
</div>
